package fjut.acm.coding.service.Impl;

import fjut.acm.coding.entity.UserProblemSolved;
import fjut.acm.coding.mapper.UserProblemSolvedMapper;
import fjut.acm.coding.service.UserProblemSolvedService;
import org.springframework.stereotype.Service;

import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;


@Service
public class UserProblemSolvedServiceImpl implements UserProblemSolvedService {
    @Resource
    UserProblemSolvedMapper userProblemSolvedMapper;

    @Override
    public UserProblemSolved selectUserSolved(String username, Integer problemId) {
        Example example = new Example(UserProblemSolved.class);
        example.createCriteria().andEqualTo("username", username)
                .andEqualTo("problemId", problemId);
        return userProblemSolvedMapper.selectOneByExample(example);
    }
}
